]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
window-tracker: Always enable transient_for redirection
authorFlorian Müllner <fmuellner@gnome.org>
Fri, 17 Jan 2014 15:54:13 +0000 (10:54 -0500)
committerFlorian Müllner <fmuellner@gnome.org>
Wed, 22 Jan 2014 18:52:49 +0000 (13:52 -0500)
It is possible to associate an application's window with a different
application using the transient_for hint. However we currently only
consider the hint in get_window_app() and not when making the original
association, which opens the door to some confusing inconsistencies;
for instance, get_window_app() will not necessarily return the same
value for all windows retrieved via shell_app_get_windows().
Fix this by looking at the transient_for hint when making the original
association, not just in get_window_app().

https://bugzilla.gnome.org/show_bug.cgi?id=722434

src/shell-window-tracker.c

index 9cb48986ee423c903a11c908ef11a26f69427567..1e3d20a939d3efef495629bdf475ce76c0e6c1cf 100644 (file)
@@ -384,8 +384,13 @@ get_app_for_window (ShellWindowTracker    *tracker,
                     MetaWindow            *window)
 {
   ShellApp *result = NULL;
+  MetaWindow *transient_for;
   const char *startup_id;
 
+  transient_for = meta_window_get_transient_for (window);
+  if (transient_for != NULL)
+    return get_app_for_window (tracker, transient_for);
+
   /* First, we check whether we already know about this window,
    * if so, just return that.
    */
@@ -681,13 +686,8 @@ ShellApp *
 shell_window_tracker_get_window_app (ShellWindowTracker *tracker,
                                      MetaWindow         *metawin)
 {
-  MetaWindow *transient_for;
   ShellApp *app;
 
-  transient_for = meta_window_get_transient_for (metawin);
-  if (transient_for != NULL)
-    metawin = transient_for;
-
   app = g_hash_table_lookup (tracker->window_to_app, metawin);
   if (app)
     g_object_ref (app);